import 'package:flutter/material.dart';

class LoginPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return LoginPageState();
  }
}

class LoginPageState extends State {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text("登陆", style: TextStyle(), textAlign: TextAlign.center,),
      ),
      body: Center(
      child: Column(
        children: <Widget>[
          new TextField(
            autofocus: true,
            decoration: InputDecoration(
                labelText: "用户名",
                hintText: "用户名",
                prefixIcon: Icon(Icons.person)),
          ),
          new TextField(
            decoration: InputDecoration(
                labelText: "密码",
                hintText: "您的登录密码",
                prefixIcon: Icon(Icons.lock)),
          ),
          FlatButton(
            child: Text("登陆"),
            color: Colors.blue,
            colorBrightness: Brightness.dark,
            splashColor: Colors.grey,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0)),
            onPressed: () {
              Navigator.pushNamed(context, "/home");
            },
          )
        ],
      ),
    ),
    );
  }
}
